package com.wwc.service;

import com.wwc.entities.CommonResult;
import com.wwc.entities.Payment;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Component
@FeignClient(value = "PAYMENT-SERVICE")
public interface PaymentOpenFeignService{
	@PostMapping(value = "/payment/createPayment")
	CommonResult<Integer> createPayment(@RequestBody Payment payment);
	
	@GetMapping(value = "/payment/getDiscovery")
	CommonResult<DiscoveryClient> getDiscovery();
	
	@GetMapping(value = "/payment/getPaymentById/{id}")
	CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);
	
	@GetMapping(value = "/payment/getService")
	CommonResult<List<String>> getService();
	
	@GetMapping(value = "/payment/feignTimeOut")
	CommonResult<String> paymentFeignTimeOut();
}
